package io.github.enbool.exception;


import io.github.enbool.enums.ResultEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=true)
public class BaseException extends RuntimeException {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Integer code;
	
	public BaseException(Integer code, String message) {		
		super(message);
		this.code = code;
	}
	
	public BaseException(ResultEnum resultEnum) {		
		super(resultEnum.getMessage());
		this.code = resultEnum.getCode();
	}

}
